package d2_com.itheima.io;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.nio.charset.Charset;

/**
 * 打印流
 */
public class Test7 {
    public static void main(String[] args) {
        //支持字节数组打印
        try (PrintStream ps = new PrintStream("oop-app6\\9.txt", Charset.forName("GBK"))) {
            ps.println(97);
            ps.println('a');
            ps.println("我是你爹~");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        //支持字符数组打印
        try (PrintWriter ps = new PrintWriter("oop-app6\\10.txt", Charset.forName("GBK"))) {
            ps.println("我是你爹~");
            ps.println(97);
            ps.println('a');
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
